package com.cui.project.utils;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author: 崔老爷
 * Date: 2024/10/23 19:18
 * @Description:
 */
public class DateFormatUtil {

    public static String formatDate(String originalDate) {
        DateTimeFormatter originalFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        DateTimeFormatter targetFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");

        LocalDateTime dateTime = LocalDateTime.parse(originalDate, originalFormat);
        return dateTime.format(targetFormat);
    }
}
